package CompositePattern;

import java.util.Collections;
import java.util.List;

public class Employee {
    private String name;
    private String dept;
    private int salary;
    List<Employee> subordinates;

    public Employee(String name, String dept, int salary) {
        this.name = name;
        this.dept = dept;
        this.salary = salary;
        this.subordinates  = Collections.emptyList();
    }

    public void add(Employee employee){
        this.subordinates.add(employee);
    }

    private void remove(Employee e){
        this.subordinates.remove(e);
    }

    public List<Employee> getSubordinates() {
        return subordinates;
    }
}
